From: Colin Walters Date: Thu, 11 Aug 2011 09:47:38 +0000 (-0400) Subject: ShellApp: Use stable sequence for id, not pointer address X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7956 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b0cc778c49fe7d0829b46e4236053d407a2a597c;p=gnome-shell.git ShellApp: Use stable sequence for id, not pointer address As danw points out, "It's unique during the lifetime of the window, but reasonably likely to be reused by another window after this one is destroyed. Using meta_window_get_stable_sequence() might be better." https://bugzilla.gnome.org/show_bug.cgi?id=648149 --- diff --git a/src/shell-app.c b/src/shell-app.c index b6ff31bc3..1ff989429 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -777,11 +777,7 @@ _shell_app_new_for_window (MetaWindow *window) app = g_object_new (SHELL_TYPE_APP, NULL); - /* For windows, its id is simply its pointer address as a string. - * There are various other alternatives, but the address is unique - * and unchanging, which is pretty much the best we can do. - */ - app->window_id_string = g_strdup_printf ("window:%p", window); + app->window_id_string = g_strdup_printf ("window:%d", meta_window_get_stable_sequence (window)); _shell_app_add_window (app, window);